package org.jupiter.blog.api.convertor;

import org.jupiter.blog.api.domain.JupiterRole;
import org.jupiter.blog.api.dto.JupiterRoleDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")
public interface JupiterRoleStructConvertor {

	@Mapping(target = "createTime", ignore = true)
	@Mapping(target = "updateTime", ignore = true)
	@Mapping(target = "deleteTime", ignore = true)
	JupiterRole toEntity(JupiterRoleDTO dto);

	JupiterRoleDTO toDto(JupiterRole role);

	List<JupiterRoleDTO> toDtoList(List<JupiterRole> roles);

	List<JupiterRole> toEntityList(List<JupiterRoleDTO> dtos);
}
